package com.geline.mybatisplus.interceptor.inner;

import cn.hutool.crypto.SecureUtil;
import com.geline.cloud.util.StringUtils;
import com.geline.mybatisplus.handler.DSLockedHandler;

/**
 * @author mx
 * @date 2025/11/12
 */
public class MD5FieldHandler implements DSLockedHandler {

    @Override
    public String encryptStr(String secretKey, String text) {
        if(StringUtils.isNotBlank(text)){
            return SecureUtil.md5(text+":"+secretKey);
        }
        return "";
    }

    @Override
    public String decryptStr(String secretKey, String text) {
        throw new UnsupportedOperationException("不支持解密MD5");
    }
}
